# coding:utf-8

from databaseHandler import *
from datetime import datetime
from .userModel import *
from .articleModel import *

# 帖子回复的数据库模型


class Reply(db.Entity):
    article = Required('Article')  # 属于哪个帖子的回复
    author = Required('User', reverse='replys')  # 帖子的作者
    likes = Required(int)  # 回复获得的赞
    userWhoLiked = Set('User', reverse='likedReplys')  # 给回复点赞的人
    favorite = Set('User', reverse='favoritedReplys')  # 收藏回复的人
    reply_contents = Required(str)  # 回复的内容
    created_time = Required(datetime)  # 回复的时间
